package com.uplooking.controller;

import com.uplooking.service.AddArtical;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.ws.Response;
import java.io.IOException;
import java.sql.SQLException;

public class AddArticalController extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       resp.setContentType("application/json;charset=utf8");
       String username=req.getParameter("username");
        String title = req.getParameter("title");
        String artical = req.getParameter("artical");
        AddArtical addArtical = new AddArtical();
        try {
            Integer addArtical1 = addArtical.getAddArtical(username, title, artical);
            resp.getWriter().print(0);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
